-
Notifications
You must be signed in to change notification settings - Fork 1.7k
List possible values for configuration enums #15216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Feel free to give advice about how this can be done less "hardcoded". Unfortunately, iterating over enums isn't a rust thing. |
I'm not sure about making it less hardcoded, but what could be a very appreciated addition to this PR is checking for the possible values array on |
Depending on how much we want this, this could be emulated with not too much work by wrapping the enum definition around a macro that outputs an associated const with the variant names: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=11528b07df66ce90ac71c72b279887c2 |
I like the idea, but I'm not sure how to make define_Conf support either an array of values (good if we want to put something custom like "any type name") or a const expression. |
I'm not familiar enough with update_lints to make the other suggestion in a short amount of time, so I'm going to leave it like this for now. |
r? @y21 I'll let you shepherd this PR through. I like the idea, but don't have the time to do the necessary investigations/suggestions on how to make this more automated. |
Co-authored-by: Alejandra González <blyxyas@gmail.com>
I had to look at clippy's implementation to see what the possible enum values were, so I am making it possible for that information to be more visible with this change.
changelog: Improved lint configuration documentation to show possible enumeration values.